<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" />
  <xsl:template match="/">
    <HTML>
      <HEAD>
        <title>
          CopyIT
        </title>
        <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"></meta>
        <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"></meta>
        <style type="text/css">
          .styleCopied
          {
          border-top-style: solid;

          border-right-style: solid;
          border-left-style: solid;
          border-bottom-style: solid;
          border-left-color: #667766;
          border-bottom-color: #667766;
          border-top-color: #667766;
          border-right-color: #667766;
          border-top-width: thin;
          border-bottom-width: thin;
          border-left-width: thin;
          border-right-width: thin;
          font-family: microsoft sans serif;
          font-size: 8.25pt;
          }
          .leftborder
          {
          border-left-style: solid;
          border-left-color: #667766;
          border-left-width: 1px;
          }
          .Hleftborder
          {
          border-left-style: solid;
          border-left-color: #667766;
          border-left-width: 1px;
          border-bottom-style: solid;
          border-bottom-color: #667766;
          border-bottom-width: 1px;
          }
          .HBborder
          {
          border-bottom-style: solid;
          border-bottom-color: #667766;
          border-bottom-width: 1px;
          }
        </style>
      </HEAD>
      <BODY>
        <table class="styleCopied">
          <TR >
            <TH class="HBborder" align="center" colspan="3" bgcolor="yellow">File correttamente copiati</TH>
          </TR>
          <TR>
            <TH class="HBborder">Operazione</TH>
            <TH class="Hleftborder">Tipo</TH>
            <TH class="Hleftborder">Nome</TH>
          </TR>
          <xsl:apply-templates select="copyit/filecopied/*"/>
        </table>

        <xsl:variable name="Totale">
          <xsl:value-of select="count(copyit/errors/*)"/>
        </xsl:variable>

        <xsl:if test="$Totale>0">
          <br></br>
          <table class="styleCopied">
            <TR >
              <TH class="HBborder" align="center" colspan="4" bgcolor="red">Errori riscontrati</TH>
            </TR>
            <TR>
              <TH class="HBborder">Operazione</TH>
              <TH class="Hleftborder">Tipo</TH>
              <TH class="Hleftborder">Nome</TH>
              <TH class="Hleftborder">Errore</TH>
            </TR>
            <xsl:apply-templates select="copyit/errors/*"/>
          </table>
        </xsl:if>
      </BODY>
    </HTML>
  </xsl:template>

  <xsl:template match="copyit/filecopied/*">
    <TR>
      <TD class="noline">
        <xsl:value-of select="@operation"/>
      </TD>
      <TD class="leftborder">
        <xsl:value-of select="@type"/>
      </TD>
      <td class="leftborder">
        <xsl:value-of select="@name"/>
      </td>
    </TR>
  </xsl:template>

  <xsl:template match="copyit/errors/*">
    <TR>
      <TD>
        <xsl:value-of select="@operation"/>
      </TD>
      <TD class="leftborder">
        <xsl:value-of select="@type"/>
      </TD>
      <td class="leftborder">
        <xsl:value-of select="@name"/>
      </td>
      <td class="leftborder">
        <xsl:value-of select="."/>
      </td>
    </TR>
  </xsl:template>
</xsl:stylesheet>

